<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2020 Readium Foundation. All rights reserved.
  Use of this source code is governed by the BSD-style license
  available in the top-level LICENSE file of the project.
-->

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:paddingBottom="8dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        >

        <TextView
            android:id="@+id/timelinePosition"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:minWidth="40dp"
            android:text="@string/zero"
            app:layout_constraintBottom_toBottomOf="@+id/publicationTitle"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@+id/publicationTitle"
            />

        <TextView
            android:id="@+id/publicationTitle"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginTop="8dp"
            android:layout_marginEnd="8dp"
            android:ellipsize="end"
            android:gravity="center"
            android:maxLines="1"
            android:scrollHorizontally="true"
            android:textSize="18sp"
            app:layout_constraintEnd_toStartOf="@+id/timelineDuration"
            app:layout_constraintStart_toEndOf="@+id/timelinePosition"
            app:layout_constraintTop_toTopOf="parent"
            tools:text="Chapter"
            />

        <TextView
            android:id="@+id/timelineDuration"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginEnd="16dp"
            android:minWidth="40dp"
            android:text="@string/zero"
            app:layout_constraintBottom_toBottomOf="@+id/publicationTitle"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="@+id/publicationTitle"
            />

        <SeekBar
            android:id="@+id/timelineBar"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginTop="8dp"
            android:layout_marginEnd="8dp"
            android:contentDescription="@string/seek_bar"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/publicationTitle"
            />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <ImageView
        android:id="@+id/coverView"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:adjustViewBounds="true"
        android:contentDescription="@string/cover_image"
        android:cropToPadding="true"
        android:scaleType="fitCenter"
        />

    <LinearLayout
        android:id="@+id/controls"
        android:layout_width="match_parent"
        android:layout_height="70dp"
        android:gravity="center_vertical|center_horizontal"
        android:orientation="horizontal"
        android:weightSum="5"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        >

        <ImageButton
            android:id="@+id/skipBackward"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:layout_weight="1"
            android:background="@android:color/transparent"
            android:contentDescription="@string/go_backward_30_seconds"
            android:scaleType="fitCenter"
            android:src="@drawable/outline_replay_30_24" />

        <ImageButton
            android:id="@+id/playPause"
            android:layout_width="50dp"
            android:layout_height="70dp"
            android:layout_weight="1"
            android:background="@android:color/transparent"
            android:contentDescription="@string/play_or_pause"
            android:scaleType="fitCenter"
            android:src="@drawable/ic_baseline_pause_24" />

        <ImageButton
            android:id="@+id/skipForward"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:layout_weight="1"
            android:background="@android:color/transparent"
            android:contentDescription="@string/go_forward_30_seconds"
            android:scaleType="fitCenter"
            android:src="@drawable/outline_forward_30_24" />

    </LinearLayout>

</LinearLayout>
